package net.huashitong.ssydt.provider.config;

import net.huashitong.ssydt.provider.utils.date.DateUtils;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.convert.converter.Converter;

import java.util.Date;

/**
 * @author hemj
 * @date 2017/8/18
 */
@Configuration
public class ConvertConfiguration {

	@Bean
	public Converter<String, Date> addNewConvert() {
		return new Converter<String, Date>() {
			@Override
			public Date convert(String source) {
				return DateUtils.parseDate(source);
			}
		};
	}

}
